package com.suixingfu.utils;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.multipart.MultipartFile;

import com.alibaba.fastjson.JSONObject;

public class UploadPathUtils {

	//上传文件路径
	public static String uploadPath(MultipartFile file,HttpServletRequest request){
		String file_json=FileUploadUtils.queryFileData(file, request);//上传文件保存到文件夹
		JSONObject file_object=JSONObject.parseObject(file_json);
		String fos_name=file_object.getString("filename");//上传文件名
		String filepath=request.getSession().getServletContext()
                .getRealPath("/Web-INF/uploadFile/" + fos_name);//上传文件路径
		return filepath;
	}

}
